<template>
    <tr>
      <td><input type="checkbox" v-model="checked" @click="check(name,!checked)" /></td>
      <td>{{ name }}</td>
      <td>{{ price }}</td>
      <td><button @click="num--">-</button>{{ num }} <button @click="num++">+</button></td>
      <td>{{ price * num }}</td>
      <td><button @click="del(name)">删除</button></td>
    </tr>
</template>

<script>
export default {
  props: ['name', 'price', 'num', 'checked'],
  data () {
    return {
    }
  },

  created () {},

  methods: {
    del (name) {
      this.$emit('del', name)
    },
    check (name, ck) {
      console.log(this.bool)
      // this.checked = this.bool
      this.$emit('check', name, ck)
    }
  }
}
</script>

<style scoped lang="less"></style>
